package exception;

import java.util.InputMismatchException;
import java.util.Scanner;
/*
*
 */
public class Divide1 {
    public static void main(String[] args){
        int a,b,c;//定义变量
        Scanner in = new Scanner(System.in);//实例化Scanner对象
        System.out.println("输入两个整数：");//用户提示
        try {
            a=in.nextInt();//输入一个整数存入变量a
            b=in.nextInt();//输入一个整数存入变量b
            try {
                c=a/b;
                System.out.println("商为: "+c);
            } catch (Exception e) {
                System.out.println("除数不能为零！ ");
            }
        } catch (Exception e) {
            System.out.println("只能输入数字！");
        }

    }
}
